package com.motiontheory.inttest;

import java.util.Date;

public class MockScene {
	private String id;
	private String filterClassName;
	private String caption;
	private String createdBy;
	private long createdAt;

    public MockScene ()
    {
        this.id = null;
        this.filterClassName = null;
        this.caption = null;
        this.createdBy = null;
        this.createdAt = 0;
    }
	public MockPropScene[] props = {new MockPropScene(), new MockPropScene(), new MockPropScene()};
	
	public MockScene (String creatorName, int idUniqKey)
    {
    	Date date = new Date();
    	this.createdAt = date.getTime() / 1000;
    	this.id = creatorName + "-" + createdAt + "-" + idUniqKey;
    	
    	this.caption = creatorName + " Test scene caption";
    	this.filterClassName = null;
    	this.createdBy = creatorName;
    }

	public String getId ()
    {
    	return id;
    }
    public void setId ( String id )
    {
    	this.id = id;
    }
	public String getFilterClassName ()
    {
    	return filterClassName;
    }
    public void setFilterClassName ( String filter )
    {
    	this.filterClassName = filter;
    }
	public String getCaption ()
    {
    	return caption;
    }
    public void setCaption ( String caption )
    {
    	this.caption = caption;
    }
	public String getCreator ()
    {
    	return createdBy;
    }
    public void setCreator ( String user )
    {
    	this.createdBy = user;
    }
	public long getTimestamp ()
    {
    	return createdAt;
    }
    public void setTimestampy ( long ts )
    {
    	this.createdAt = ts;
    }
   

    public String toJson(){

    	String jsonForm = "{" +
    			"\"sceneData\":{" +											// в старой версии не заворачиваем в sceneData !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    			"\"id\":\"" + getId() +
    			"\",\"filterClassName\":" + getFilterClassName() +
    			",\"caption\":\"" + getCaption() +
    			"\",\"propList\":[" + props[0].toJson() +
    			"," + props[1].toJson() +
    			"," + props[2].toJson() +
    			"]," +
    			"\"createdBy\":\"" + getCreator() +
    			"\",\"createdAt\":" + getTimestamp() +
    			"}" +
    			"}";
    	return jsonForm;
    }

}
